s<extend name="Base/common"/>
<block name="style">
    <style type="text/css">
    .head_head{
        height:20%;
        width:100%;

    }
    .head_label{
        width: 100%;
        display: block;
        text-align: center;
        font-size: 16px;

    }
    .head_value{
        width: 100%;
        margin-top: -15px;
        display: block;
        text-align: center;
        font-size: 30px;
        color:#000;

    }
    .head_daoqi{
        width: 100%;
        display: block;
        height:20px;
        margin-top: -15px;
        text-align: center;
        font-size: 12px;


    }

    </style>
</block>
<block name="body">
<div style="position:relative;">
    <div class="page__bd" >
    	<if condition="$type eq 1">
				            <div class="weui-form-preview">
					            <div class="weui-form-preview__bd" style="margin-top:-6px;">
					                <span class="head_label">金额</span>
					                <span class="head_value"> {$info.pay_money}</span>

					                <if condition="$info[status] eq 1">
					                    <span class="head_daoqi" style="color:orange;">成功</span>
					                <else/>
					                    <span class="head_daoqi" style="color:red;">失败</span>
					                </if>
					                
					            </div>


					            <div class="weui-form-preview__bd" style="margin-top:-10px;">
					                <div class="weui-form-preview__item" style="position:relative;">
				                        <label class="weui-form-preview__label">收款平台单号</label>
				                        <span class="weui-form-preview__value" >{$info.danhao} </span>  
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">收款支付宝单号</label>
					                    <span class="weui-form-preview__value" >{$info.trade_no} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">收款金额</label>
					                    <span class="weui-form-preview__value" >{$info.pay_money} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">付款账号</label>
					                    <span class="weui-form-preview__value" >{$info.buyer} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">交易时间</label>
					                    <span class="weui-form-preview__value">{$info.pay_time|date='Y-m-d H:i:s',###}</span>
					                </div>


					                
				                    <php>
				                    	$trans=D('Trans')->where(['trade_no'=>$info['trade_no']])->find();
				                    </php>
				                    <notempty name="trans">
										<div class="weui-form-preview__item">
						                    <label class="weui-form-preview__label">回款金额</label>
						                    <span class="weui-form-preview__value" ><php>echo $trans['money'];</php></span>
						                </div>


						                <div class="weui-form-preview__item">
						                    <label class="weui-form-preview__label">回款平台单号</label>
						                    <span class="weui-form-preview__value" >{$trans.out_biz_no} </span>
						                </div>


						                <div class="weui-form-preview__item">
						                    <label class="weui-form-preview__label">回款支付宝单号</label>
						                    <span class="weui-form-preview__value" >{$trans.trade_num} </span>
						                </div>
						                <div class="weui-form-preview__item">
						                    <label class="weui-form-preview__label">回款时间</label>
						                    <span class="weui-form-preview__value" >{$trans.time} </span>
						                </div>

						                <div class="weui-form-preview__item">
						                    <label class="weui-form-preview__label">回款状态</label>
						                    <if condition="$trans[status] eq 1">
							                    <span class="weui-form-preview__value" style="color:orange;">成功</span>
							                <else/>
							                    <span class="weui-form-preview__value" style="color:red;">失败</span>
							                </if>
						                </div>

						                <div class="weui-form-preview__item">
						                    <label class="weui-form-preview__label">本次收益</label>
						                    <span class="weui-form-preview__value" >{$info.yh_money} </span>
						                </div>

				                    </notempty>
					            </div>
					           
					    	</div>

		<elseif condition="$type eq 2"/>
		<!-- 分润 -->
							<div class="weui-form-preview">
					            <div class="weui-form-preview__bd" style="margin-top:-6px;">
					                <span class="head_label">金额</span>
					                <span class="head_value"> {$info.total}</span>

					                <if condition="$info[status] eq 1">
					                    <span class="head_daoqi" style="color:orange;">成功</span>
					                <else/>
					                    <span class="head_daoqi" style="color:red;">失败</span>
					                </if>
					                
					            </div>


					            <div class="weui-form-preview__bd" style="margin-top:-10px;">
					                <div class="weui-form-preview__item" style="position:relative;">
				                        <label class="weui-form-preview__label">平台单号</label>
				                        <span class="weui-form-preview__value" >{$info.danhao} </span>  
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">当笔支付宝单号</label>
					                    <span class="weui-form-preview__value" >{$info.trade_no} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">分润所得金额</label>
					                    <span class="weui-form-preview__value" >{$info.divide}</span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">分润时间</label>
					                    <span class="weui-form-preview__value">{$info.time|date='Y-m-d H:i:s',###}</span>
					                </div>

					            </div>
					           
					    	</div>


		<elseif condition="$type eq 3"/>
		<!-- 提现 -->
							<div class="weui-form-preview">
					            <div class="weui-form-preview__bd" style="margin-top:-6px;">
					                <span class="head_label">提现金额</span>
					                <span class="head_value"> {$info.money}</span>

					                <if condition="$info[status] eq 1">
					                    <span class="head_daoqi" style="color:orange;">成功</span>
					                <else/>
					                    <span class="head_daoqi" style="color:red;">失败</span>
					                </if>
					                
					            </div>


					            <div class="weui-form-preview__bd" style="margin-top:-10px;">
					                <div class="weui-form-preview__item" style="position:relative;">
				                        <label class="weui-form-preview__label">平台单号</label>
				                        <span class="weui-form-preview__value" >{$info.out_biz_no} </span>  
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">支付宝单号</label>
					                    <span class="weui-form-preview__value" >{$info.order_id} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">到账金额</label>
					                    <span class="weui-form-preview__value" >{$info.money}</span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">付款方</label>
					                    <span class="weui-form-preview__value" >绿叶收银台</span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">收款方</label>
					                    <php>
					                    	$yh=D('Ptyh')->where(['uid'=>$info['uid']])->find();
					                    	$alipay=substr($yh['alipay'], 0,2).'****'.substr($yh['alipay'], -7);
					                    </php>
					                    <span class="weui-form-preview__value" >{$yh.name} {$alipay} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">交易时间</label>
					                    <span class="weui-form-preview__value">{$info.time|date='Y-m-d H:i:s',###}</span>
					                </div>

					            </div>
					           
					    	</div>
			<elseif condition="$type eq 4"/>
			<!-- 分润 -->
							<div class="weui-form-preview">
					            <div class="weui-form-preview__bd" style="margin-top:-6px;">
					                <span class="head_label">金额</span>
					                <span class="head_value"> {$info.money_in}</span>

					                <if condition="$info[status] eq 1">
					                    <span class="head_daoqi" style="color:orange;">成功</span>
					                <else/>
					                    <span class="head_daoqi" style="color:red;">失败</span>
					                </if>
					                
					            </div>


					            <div class="weui-form-preview__bd" style="margin-top:-10px;">
					                <div class="weui-form-preview__item" style="position:relative;">
				                        <label class="weui-form-preview__label">平台单号</label>
				                        <span class="weui-form-preview__value" >{$info.out_request_no} </span>  
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">当笔支付宝单号</label>
					                    <span class="weui-form-preview__value" >{$info.trade_no} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">口碑收益金额</label>
					                    <span class="weui-form-preview__value" >{$info.sh_money}</span>
					                </div>


					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">收益时间</label>
					                    <span class="weui-form-preview__value">{$info.time|date='Y-m-d H:i:s',###}</span>
					                </div>

					            </div>
					           
					    	</div>
	    	<elseif condition="$type eq 5"/>
			<!-- 油卡 -->
							<div class="weui-form-preview">
					            <div class="weui-form-preview__bd" style="margin-top:-6px;">
					                <span class="head_label">金额</span>
					                <span class="head_value"> {$info.yh_money}</span>

					                <if condition="$info[re_status] eq 1">
					                    <span class="head_daoqi" style="color:orange;">成功</span>
					                <elseif condition="$info[re_status] eq 2"/>
					                    <span class="head_daoqi" style="color:red;">失败</span>
					                <else/>
					                	<span class="head_daoqi" style="color:blue;">处理中</span>
					                </if>
					                
					            </div>


					            <div class="weui-form-preview__bd" style="margin-top:-10px;">
					                <div class="weui-form-preview__item" style="position:relative;">
				                        <label class="weui-form-preview__label">平台单号</label>
				                        <span class="weui-form-preview__value" >{$info.orderId} </span>  
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">提交卡号</label>
					                    <span class="weui-form-preview__value" >{$info.cardNumber} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">提交卡密</label>
					                    <span class="weui-form-preview__value" >
					                    	<php>echo substr($info['cardPwd'], 0,4).'****'.substr($info['cardPwd'], -3);</php>
					                    </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">面值</label>
					                    <span class="weui-form-preview__value" >{$info.face}</span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">折扣</label>
					                    <span class="weui-form-preview__value" >{$info.price}</span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">核销期限</label>
					                    <span class="weui-form-preview__value" ><php>echo date($info['effectTime']);</php></span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">本次收益</label>
					                    <span class="weui-form-preview__value" >{$info.yh_money} </span>
					                </div>

					                <div class="weui-form-preview__item">
					                    <label class="weui-form-preview__label">提交时间</label>
					                    <span class="weui-form-preview__value">{$info.time|date='Y-m-d H:i:s',###}</span>
					                </div>

					            </div>
					           
					    	</div>
		</if>
    </div>

</block>
<block name="script">

    


    <script>

    // $('.cs').click(function(){
    //     var val=$('#cs').val();
    //      $.ajax({
    //         type:'post',
    //         url:"{:U('llpay_notify')}",
    //         data:{'val':val},
    //         // dataType:'json',
    //         success:function(m){
    //             popup.alert(m)
    //         }
    //     });
    // })





    var select='';
    var id=$('#hidden').val();




    var day=0;
    
        $('.for_pay').click(function(){
            select=$(this).val();
            if(select=='延期还款'){
                $('.day').css('display','block');
                $('._sure').click(function(){
                    day=$('.day :checked').val();
                    $('.day').css('display','none');
                    $('.block').css('display','block');
                });

            }else{
                $('.block').css('display','block');
            }
            
           
        })
        //点击确定

        $('.sure').click(function(){
            
            var payment=$('.pay :checked').val();
            if(payment==3){   //主动还款
                $('form').attr('action','https://wap.lianlianpay.com/installment.htm');
                if(select=='延期还款'){

                    $.ajax({
                        type:'post',
                        url:"{:U('llpay')}",
                        data:{'id':id,'type':'delay','day':day},
                        dataType:'json',
                        success:function(m){
                            
                            $('#zdhk').val(m);
                            $("form").submit();
                        }
                    });
                    
                }else if(select=='立即还款'){ 
                    $.ajax({
                        type:'post',
                        url:"{:U('llpay')}",
                        data:{'id':id,'type':'promptly'},
                        dataType:'json',
                        success:function(m){
                            // popup.alert(m)

                            $('#zdhk').val(m);
                            $("form").submit();
                        }
                    });
                }
                
                
            }else if(payment==2){       //支付宝   {:U('alipay?type=promptly&id='.$info['id'])}       
                if(select=='延期还款'){
                    location.href="{:U('alipay?type=delay&id=')}"+id+'&day='+day;
                }else if(select=='立即还款'){ 
                    // alert()
                    id=$('#hidden').val();
                    location.href="{:U('alipay?type=promptly&id=')}"+id;
                }
            }else{
                // 提前还款  使用已绑定的银行卡还款
                if(select=='延期还款'){
                    popup.alert('延期费用不支持该支付方式！')
                    
                }else if(select=='立即还款'){ 
                    id=$('#hidden').val();

                    $.ajax({
                        type:'post',
                        url:"{:U('agreenoauthapply')}",
                        // url:"{:U('signApply')}",
                        data:{'id':id},
                        dataType:'json',
                        success:function(m){
                            confirm(m.info)
                            location.reload();

                        }
                    });
                }
            }
        });


        //点击隐藏
        $(".box").click(function(e){
            $(this).show();
            e.stopPropagation();//阻止冒泡
        });
        $('.block').click(function(){
            $(".block").hide();
         
        })


        $('.clz').click(function(){
             popup.alert('批扣处理中，暂不能主动支付');
         })

        $('.chakan').click(function(){
             location.href="http://weixin.jcsmkj.cn/index.php?m=weixin&c=capital&a=agreement&show=1&id="+id;
        })
    </script>

</block>

﻿﻿﻿

